package com.example.helloAndroidGraphics;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.util.AttributeSet;
import android.view.View;

public class GraphicsView extends View{
	
	Path circle;
	Paint paint;
	int circleColor;
	int textColor;
	
	
	public GraphicsView(Context c, AttributeSet as) {
		super(c);
		circle = new Path();
		circle.addCircle(150, 150, 100, Direction.CW);
		paint = new Paint();
		paint.setAntiAlias(true);
		circleColor = getResources().getColor(R.color.circle);
		textColor = getResources().getColor(R.color.text);
		setBackgroundResource(R.drawable.background);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		paint.setColor(circleColor);
		canvas.drawPath(circle, paint);
		paint.setColor(textColor);
		paint.setTextSize(20.0f);
		canvas.drawTextOnPath(getContext().getString(R.string.text), circle, 0, 20, paint);
	}
	
	
	
}